package com.slz3.business.module.configManagement.conZone.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.configManagement.conZone.domain.ConZone;
import com.slz3.business.module.configManagement.conZone.domain.ConZoneCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class ConZoneResAtomic {

    static Mono<ServerResponse> add_$ConZoneUpdateLock(ServerRequest req, ConZone conZone) {
        return ConZoneResSafeValid.add(req, conZone) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneResExecutor.add(req, conZone);
    }

    public static Mono<ServerResponse> delete_$ConZoneUpdateLock(ServerRequest req, ConZoneCondition conZoneCondition) {
        return ConZoneResSafeValid.delete(req, conZoneCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneResExecutor.delete(req);
    }

    static Mono<ServerResponse> modify_$ConZoneUpdateLock(ServerRequest req, ConZone conZone) {
        return ConZoneResSafeValid.modify(req, conZone) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneResExecutor.modify(req, conZone);
    }

    static Mono<ServerResponse> info_$ConZoneUpdateLock(ServerRequest req) {
        return ConZoneResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneResExecutor.info(req);
    }

    public static Mono<ServerResponse> auditSubmit_$ConZoneUpdateLock(ServerRequest req, ConZoneCondition conZoneCondition) {
        return ConZoneResSafeValid.auditSubmit(req, conZoneCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneResExecutor.auditSubmit(req);
    }

    public static Mono<ServerResponse> audit_$ConZoneUpdateLock(ServerRequest req, ConZoneCondition conZoneCondition) {
        return ConZoneResSafeValid.audit(req, conZoneCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneResExecutor.audit(req);
    }

    public static Mono<ServerResponse> auditReject_$ConZoneUpdateLock(ServerRequest req, ConZoneCondition conZoneCondition) {
        return ConZoneResSafeValid.auditReject(req, conZoneCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneResExecutor.auditReject(req);
    }


    public static Mono<ServerResponse> usingEnable_$ConZoneUpdateLock(ServerRequest req, ConZoneCondition conZoneCondition) {
        return ConZoneResSafeValid.usingEnable(req, conZoneCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneResExecutor.usingEnable(req);
    }

    public static Mono<ServerResponse> usingDisable_$ConZoneUpdateLock(ServerRequest req, ConZoneCondition conZoneCondition) {
        return ConZoneResSafeValid.usingDisable(req, conZoneCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneResExecutor.usingDisable(req);
    }
}
